import java.util.Arrays;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: XMQ
 * Date: 2022-05-28
 * Time: 10:40
 */

public class Test {

    public static void main(String[] args) {
        String s1 = "hello";
        String s2 = s1 + " word";
        System.out.println(s2);
    }
    public static void main3(String[] args) {
        String s = "hi ni hao a";
        String[] str = s.split(" ",3);
        for (int i = 0; i < str.length; i++) {
            System.out.println(str[i]);
        }
    }
    public static int[] smallerNumbersThanCurrent(int[] nums) {
        //哈希
        int[] hash = new int[101];
        int[] arr = new int[nums.length];
        for(int i = 0; i < nums.length; i++){
            ++hash[ nums[i] ];
        }
        int count = 0;
        for(int i = 0; i < nums.length; i++){
            for (int j = 0; j < nums[i]; j++) {
                count += hash[j];
            }
            arr[i] = count;
            count = 0;
        }
        return arr;
    }

    public static void main2(String[] args) {
        int[] nums = {6,5,4,8};
        System.out.println(Arrays.toString(smallerNumbersThanCurrent(nums)));
    }
    public static void main1(String[] args) {
        int n = 2;
        int[] nums = new int[(int)Math.pow(10,n)-1];
        for (int i = 0; i < Math.pow(10,n)-1; i++) {
            nums[i] = i+1;
        }
        System.out.println(Arrays.toString(nums));
    }
}
